get count of results based on groupBy laravel

76

$getUserCountries = User::select('country', DB::raw('count(*) as count'))
                          ->groupBy('country')
                          ->get()->
                          toArray();

Comments

Submit
0 Comments